home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 7
/
Apprentice-Release7.iso
/
Environments
/
PowerFantasm™ 4.19a
/
Beginners guide
/
GUIDE EXAMPLES
/
EXAMPLE4.S
< prev
next >
Wrap
Text File
|
1997-02-09
|
1KB
|
30 lines
*********************************************************
*FILENAME: EXAMPLE4.S *
*DESCRIPTION:PROGRAM TO ADD 3 NUMBERS TOGETHER *
* AND PRINT THE RESULT IN A WINDOW. *
* WRITTEN IN POSITION INDEPENDANT CODE *
*********************************************************
EXAMPLE4: LEA EX4_VARS(PC),A6
BSR INIT_CURSOR *part of io_lib.s
LEA WINDOW_TITLE(PC),A0
BSR OPEN_WINDOW *PART OF IO_LIB.S
MOVE.L A0,WINDOW_HANDLE(A6) *OPEN_WINDOW RETURNS A HANDLE TO THE WINDOW
MOVE.L #10,D0 *ADD 10 AND 20 AND 30
ADD.L #20,D0
ADD.L #30,D0
BSR PRINTNUM *part of io_lib.s - PRINTS D0
BSR WAIT_KEY *WAIT FOR A KEY TO BE PRESSED
MOVE.L WINDOW_HANDLE(A6),A0 *GET THE HANDLE FOR THE WINDOW
BSR CLOSE_WINDOW *CLOSE THE WINDOW
RTS
INCLUDE IO_LIB.S
****VARIABLES
WINDOW_HANDLE: EQU 0 *WINDOW HANDLE .L
EX4_VARS: DS.B 4 *SPACE FOR 1 LONG
WINDOW_TITLE: cstring "EXAMPLE 4" *cstring is the same as dc.b and putting a zero byte on the end
align *must be followed by an "align" directive.
************************END OF EXAMPLE4********************